<%@page import="com.training.java.redbox.struts.domain.Movie"%>
<%@page import="com.training.java.redbox.struts.domain.Customer" %>
<%@ page import="java.util.Date" %>  
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Order Summary</title>
</head>
<body>
<%@include file="Header.jsp"%> <br/><hr>

<center>Thanks for choosing Redbox!<br><br>
Following are the order Details:<br><br>
Order Number: <c:if test = "${order!=null }">
			  	<c:out value="${order.orderNumber}"></c:out>
			  </c:if><br>
			 <%--  <c:set var="currentDate" value="${ }"></c:set> --%> 
 					
 					<% 
 						Date currentDate=new Date(); 
 					%>
 					
 					<c:set var="cDate" value="<%=currentDate%>"></c:set>
 					
 					 <fmt:formatDate pattern="MM/dd/yyyy" value="${currentDate}" /><br > 
Order Date  : <c:out value= "${cDate}"></c:out>
			 
			 <c:if test ="${MoviesCart!=null}">
				<table bordercolor="blue" border="1">
					<tr>
						<th>Title</th>
						<th>Type</th>
						<th>Price</th>
					</tr>
					<c:forEach items="${MoviesCart}" var ="movie">
						<tr>
							<td><c:out value="${movie.title}"></c:out></td>
							<td><c:out value="${movie.type }"></c:out></td>
							<td><c:out value="${movie.rentalPrice}"></c:out></td>
						</tr>
					</c:forEach>
			
				</table>
			  </c:if><br>

			<c:set var="totAmt" value="0.0"></c:set>
			<c:forEach items="${MoviesCart}"  var = "movie">
			   <c:set var="totAmt" value="${totAmt + movie.rentalPrice}"></c:set>
 		    </c:forEach>

Total=  $ <c:out value="${totAmt}">
		</c:out><br>
		
		
<br><h3>Have a Great Day!</h3>
</center>
<%@include file="Footer.jsp"%>
</body>
</html>